home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIStreamConverterService.idl < prev    next >
Text File  |  2006-05-08  |  5KB  |  105 lines

  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsIInputStream.idl"
  39. #include "nsIStreamListener.idl"
  40.  
  41. %{C++
  42. #define NS_ISTREAMCONVERTER_KEY         "@mozilla.org/streamconv;1"
  43. %}
  44.  
  45. /**
  46.  * The nsIStreamConverterService is a higher level stream converter factory
  47.  * responsible for locating and creating stream converters
  48.  * (nsIStreamConverter).
  49.  *
  50.  * This service retrieves an interface that can convert data from a particular
  51.  * MIME type, to a particular MIME type. It is responsible for any intermediary
  52.  * conversion required in order to get from X to Z, assuming direct conversion
  53.  * is not possible.
  54.  *
  55.  * @author Jud Valeski
  56.  * @see nsIStreamConverter
  57.  */
  58. [scriptable, uuid(e086e1e2-40ff-4193-8b8c-bd548babe70d)]
  59. interface nsIStreamConverterService : nsISupports {
  60.  
  61.     /**
  62.      * <b>SYNCRONOUS VERSION</b>
  63.      * Converts a stream of one type, to a stream of another type.
  64.      *
  65.      * Use this method when you have a stream you want to convert.
  66.      *
  67.      * @param aFromStream   The stream representing the original/raw data.
  68.      * @param aFromType     The MIME type of aFromStream.
  69.      * @param aToType       The MIME type of the returned stream.
  70.      * @param aContext      Either an opaque context, or a converter specific
  71.      *                      context (implementation specific).
  72.      * @return              The converted stream. NOTE: The returned stream
  73.      *                      may not already be converted. An efficient stream
  74.      *                      converter implementation will convert data on
  75.      *                      demand rather than buffering the converted data
  76.      *                      until it is used.
  77.      */
  78.     nsIInputStream convert(in nsIInputStream aFromStream,
  79.                            in string aFromType,
  80.                            in string aToType,
  81.                            in nsISupports aContext);
  82.  
  83.     /**
  84.      * <b>ASYNCRONOUS VERSION</b>
  85.      * Retrieves a nsIStreamListener that receives the original/raw data via its
  86.      * nsIStreamListener::OnDataAvailable() callback, then converts and pushes 
  87.      * the data to aListener.
  88.      *
  89.      * Use this method when you want to proxy (and convert) nsIStreamListener
  90.      * callbacks asynchronously.
  91.      *
  92.      * @param aFromType     The MIME type of the original/raw data.
  93.      * @param aToType       The MIME type of the converted data.
  94.      * @param aListener     The listener that receives the converted data.
  95.      * @param aCtxt         Either an opaque context, or a converter specific
  96.      *                      context (implementation specific).
  97.      * @return              A nsIStreamListener that receives data via its
  98.      *                      OnDataAvailable() method.
  99.      */
  100.     nsIStreamListener asyncConvertData(in string aFromType, 
  101.                                        in string aToType, 
  102.                                        in nsIStreamListener aListener,
  103.                                        in nsISupports aContext);
  104. };
  105.